import time
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from selenium.webdriver.common.by import By

# 获取Edge浏览器驱动
driver = webdriver.Edge()
# 打开指定网址
driver.get('https://www.baidu.com/')
# 强等2秒
time.sleep(2)
# 窗口最大化
driver.maximize_window()
time.sleep(2)
# 点击请登录
driver.find_element(By.XPATH,'//*[@id="s-top-loginbtn"]').click()
time.sleep(2)
# 输入账号
driver.find_element(By.NAME,'userName').send_keys('15210943743')
time.sleep(2)
# 输入密码
driver.find_element(By.NAME,'password').send_keys('123456Aa')
time.sleep(2)
# 勾选协议
driver.find_element(By.ID,'TANGRAM__PSP_11__isAgree').click()
time.sleep(2)
# 点击登录
driver.find_element(By.ID,'TANGRAM__PSP_11__submit').click()
time.sleep(30)
